<template>
	<view class="main">
		<view class="tit">
			问题描述
		</view>
		<u--input placeholder="请输入问题标题" border="surround" v-model="value"></u--input>
		<!-- <input class="titinput" type="text" placeholder="请输入问题标题" /> -->
		<u--textarea v-model="value1" placeholder="请输入问题建议"></u--textarea>
		<view class="btn" @tap="onconfig">
			提交
		</view>
	</view>
</template>

<script>
	import {
		suggest
	} from '@/api/user.js'
	export default {
		data() {
			return {
				value: '',
				value1: ''
			}
		},
		onLoad() {

		},
		methods: {
			async onconfig() {
				if (this.value1.length == 0) {
					uni.showToast({
						title: '请输入您要反馈的信息',
						icon: 'none'
					})
					return
				}
				let res = await suggest({
					content: this.value1
				})
				if (res.code == 1) {
					uni.showToast({
						title: '反馈成功',
						icon: 'none'
					})
				} else {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		padding: 12px 15px;

		.tit {
			font-size: 14px;
			color: #232323;
			margin-bottom: 8px;
		}

		/deep/.u-input {
			background-color: #F7F7F7;
			font-size: 15px;
			margin-bottom: 15px;
			padding: 9px;
		}

		/deep/.u-textarea {
			background-color: #F7F7F7;
			font-size: 12px;
			margin-bottom: 15px;
		}


		.btn {
			padding: 10px;
			color: #fff;
			text-align: center;
			background-color: #0A84FF;
			border-radius: 100px;
		}
	}
</style>